package ZY11_23;

import java.io.*;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.Scanner;
//客户端
public class Test1Denglu {
    public static void main(String[] args) {
        //知道ip,端口
        try {
            Socket s = new Socket("localhost", 8888);
            InputStream in = s.getInputStream();
            OutputStream out = s.getOutputStream();
            BufferedReader br = new BufferedReader(new InputStreamReader(in));
            PrintWriter pw = new PrintWriter(out, true);
            Scanner input = new Scanner(System.in);
            pw.println("zhangsan");
            pw.println("123456");
            String reply = br.readLine();
            System.out.println("服务器说：" + reply);
//                if("byebye".equals(words))
//                    break;
//            }
            s.close();
        } catch (UnknownHostException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
